package com.cmy.test.mvp.ui.list

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.cmy.framework_base.basics.viewholder.BaseViewHolder
import com.cmy.framework_base.basics.viewholder.HolderContext
import com.cmy.framework_base.basics.viewholder.IType
import com.cmy.test.mvp.R

/**
 * @name:
 *  Test2ViewHolder
 * @package:
 *  com.cmy.test.mvp.ui.list
 * @date:
 *  2023/4/710:09
 * @author
 *    cmy
 * @description
 *
 */
class Test2ViewHolder constructor(itemView : View): BaseViewHolder(itemView) {

    override fun onBindData(data: IType) {
        super.onBindData(data)
    }


    /**
     * 适配器的实现
     */
    class Test2Factory : Factory {
        override fun onCreateViewHolder(
            holderContext: HolderContext?,
            parent: ViewGroup,
            viewType: Int
        ): BaseViewHolder {
            val inflater = LayoutInflater.from(parent.context)
            val view =  inflater.inflate(R.layout.item_test_2,parent,false)
            return Test2ViewHolder(view)
        }

        override fun getType(): String = "test2"
    }
}